<div class="box span12">
	<div class="box-header">
		<h2><i class="icon-th-list"></i><?php echo Yii::t("main","Danh sách liên hệ");?></h2>
	</div>
	<div class="box-content">
		<div class="btn-group pull-right">
			<a href="<?php echo Yii::app()->createUrl('contacts/contact/create');?>" class="btn btn-large btn-success"><i class="icon-plus"></i>&nbsp;<?php echo Yii::t("main","Thêm liên hệ");?></a>
			&nbsp;&nbsp;<a href="<?php echo Yii::app()->createUrl('contacts/contact/importFromFile');?>" class="btn btn-large btn-info"><i class=" icon-list-alt"></i>&nbsp;<?php echo Yii::t("main","Nhập từ file");?></a>
			&nbsp;&nbsp;<a href="<?php echo Yii::app()->createUrl('contacts/contact/importFromOpen');?>" class="btn btn-large btn-warning"><i class="icon-file-alt"></i>&nbsp;<?php echo Yii::t("main","Nhập từ Gmail, Yahoo");?></a>
		</div>
		<div class="clearfix"></div>
		<hr>
		<?php
		if($model->count() > 0){
		    $this->widget('zii.widgets.grid.CGridView', array(
		        'id'=>'template-grid',
		        'dataProvider'=> $model->search(),
		        // 'filter'=>$circle,
		        'loadingCssClass' => 'grid-loading',
		        'columns'=>array(
			    	array(
			            'class'=>'IndexColumnGrid',
			            'htmlOptions' => array(
			            	'class' => 'index-column-grid'
			            )
			        ),
		            array(
		                'name' => 'full_name',
			            'htmlOptions' => array(
			            	// 'style' => 'width: 200px;padding-left:10px;'
			            )
		             ),
		            array(
		                'name' => 'email',
			            'htmlOptions' => array(
			            	// 'style' => 'width: 200px;padding-left:10px;'
			            )
		            ),
		            array(
		            	'header' => Yii::t('main','Nhóm liên hệ'),
		            	'type' 	 => 'raw',
		            	'value'  => '$data->getGroupsBelong(true)' 
		            ),
		            array(
		            	'name' => 'status',
		            	'value' => 'Common::showStatusHtml($data->status)',
		            	'type' => 'raw',
		            	'htmlOptions' => array(
		            		'style' => 'width:35px !important;text-align:center;'
		            	),
		            	'headerHtmlOptions' => array(
		            		'style' => 'width:35px !important;text-align:center'
		            	),

		            ),
		            array(
		            	'name' => 'unsubscribe',
		            	'header' => Yii::t('main','Nhận tin'),
		            	'value' => 'Common::showStatusHtml(!$data->unsubscribe)',
		            	'type' => 'raw',
		            	'htmlOptions' => array(
		            		'style' => 'width:35px !important;text-align:center;'
		            	),
		            	'headerHtmlOptions' => array(
		            		'style' => 'width:35px !important;text-align:center'
		            	),
		            ),
		            array(
		            	'htmlOptions' => array(
		            		'style' => 'width: 120px;'
		            	),
		            	'class' => 'ButtonColumn',
		            	'template'=>'{addToGroup} {update} {delete}',
		            	'buttons' => array(
		            		'addToGroup' => array(
		            			'label' => '',
		            			'options' => array('class' => ' btn btn-success icon-signin','data-rel' => 'tooltip','data-original-title' => Yii::t('main','Thêm vào nhóm liên hệ')),
		            			'imageUrl' => '',
		            			'url' => ''
		            		)
		            	)
		            )
		        ),
		    ));
		}else{?>
			<div class="no-item">
				<i class="no-item-icon icon-road"></i>
				<div class="clearfix"></div>
				<h2><?php echo Yii::t("main","Chưa có liên hệ nào");?></h2>
			</div>
		<?php }?>
	</div>	
</div><!--/span-->